package ru.urfc.portal.ui.client.googlets.client.documents;

import ru.urfc.portal.ui.client.BaseDocument;
import ru.urfc.portal.ui.client.descriptor.GridDescriptor;
import ru.urfc.portal.ui.client.widgets.SelectDevices;

import com.extjs.gxt.ui.client.widget.form.DateField;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.form.TimeField;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Widget;

public class TurnonNotice extends BaseDocument {

	interface Binder extends UiBinder<Widget, TurnonNotice> {}
	private static Binder binder = GWT.create(Binder.class);

	@UiField DateField plannedDate;
	@UiField TimeField plannedTime;
	@UiField SelectDevices selectDevices;
	@UiField TextField<String> communicationNode;
	@UiField TextField<String> launchFrequencies;
	@UiField TextField<String> metrolog;	
	
	@Override
	protected void init(GridDescriptor descriptor) {
		initWidget(binder.createAndBindUi(this));
		
		descriptor.setAddFieldPathPrefix("data");
		descriptor.addDateField("plannedDate", plannedDate);
//TODO
//		descriptor.addTimeField("plannedTime", plannedTime);
		descriptor.addTextField("communicationNode", communicationNode);
		descriptor.addTextField("launchFrequencies", launchFrequencies);
		descriptor.addTextField("metrolog", metrolog);
		descriptor.setAddFieldPathPrefix("");
		
		bind(selectDevices);
	}

}
